﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<%@ Register TagPrefix="alicmsUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<%@ Register TagPrefix="alicmsUC" TagName="LanguageMenu" Src="../../language_menu.dwt.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ali:Get ID="Mail" Object="Mail" InnerID="Request.QueryString['ID']" Validate="True" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑邮件</title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css" />
<ali:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ali:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<alicmsUC:Ime Ime="true" Eot="true" runat="server" />
<script type="text/javascript">
var _page = "mail_edit";
var _lang = "<%=ContentLang%>";
var _webPath = "<%=WebPath%>";
var _imagePath = "<%=ImagePath%>";
var _id = "<%=Request.QueryString["ID"]%>";
var _every = "<%=Mail[Every]%>";
<%If Convert.IsDBNull(Mail[StartTime])%>
	var _startTime = "<%=DateTime.Now.ToString("MM'/'dd'/'yyyy HH:mm:ss")%>";
<%Else%>
	var _startTime = "<%=Convert.ToDateTime(Mail[StartTime]).ToString("MM'/'dd'/'yyyy HH:mm:ss")%>";
<%EndIf%>
var _regionLinkageData = {Element:"#Region select:first",Index:1,ID:"<%=Mail[RegionID]%>",ParentChain:null,ParentChainPage:"../region/ajax_parent_chain.aspx?ID=<%=Mail[RegionID]%>"};
var _industryLinkageData = {Element:"#Industry select:first",Index:1,ID:"<%=Mail[IndustryID]%>",ParentChain:null,ParentChainPage:"../industry/ajax_parent_chain.aspx?ID=<%=Mail[IndustryID]%>"};
var _lang_working = "正在操作...";
var _lang_operation_fail = "操作失败！";
var _lang_operation_success = "操作成功！";
var _lang_subject_empty = "主题不能空！";
var _lang_day_incorrect = "周一到周日至少必须选择一个！";
var _lang_interval_incorrect = "间隔时间不正确！";
var _lang_all_sub_industry = "-- 所有子行业 --";
var _lang_all_sub_region = "-- 所有子地区 --";
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" /></div>
	<div class="Title"><a href="../mail/list.aspx?Lang=<%=ContentLang%>">邮件列表</a> → <span class="<%=ContentLang%>Font"><%=Mail[Subject]%></span></div>
	<div class="Right"></div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left Selected"></li>
		<li class="Middle Selected">编辑</li>
		<li class="Right Selected"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../mail/log/list.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>">日志</a></li>
		<li class="Right"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<form>
		<table border="0" cellpadding="4" cellspacing="1">
			<tfoot>
				<tr><td colspan="2"><input type="submit" value="编辑" /></td></tr>
			</tfoot>
			<tbody>
				<tr>
					<th width="120">名称：</th>
					<td><input type="text" name="Subject" value="<%=Mail[Subject]%>" size="60" maxlength="150" class="Text <%=ContentLang%>Font" /></td>
				</tr>
				<tr>
					<th>所属行业：</th>
					<td id="Industry">
						<select class="<%=ContentLang%>Font">
							<option value="">-- 未指定行业 --</option>
								<ali:List Object="Industry" Condition="ParentID IS NULL">
									<ali:Record>
										<option value="<%=ID%>" InnerID="<%=InnerID%>"><%=Name%></option>
									</ali:Record>	
								</ali:List>
						</select>
					</td>
				</tr>
				<tr>
					<th>所属地区：</th>
					<td id="Region">
						<select name="Region" class="<%=ContentLang%>Font">
							<option value="">-- 未指定地区 --</option>
							<ali:List Object="Region" Condition="ParentID IS NULL">
								<ali:Record>
									<option value="<%=ID%>" InnerID="<%=InnerID%>"><%=Name%></option>
								</ali:Record>
							</ali:List>
						</select>
					</td>
				</tr>
				<tr>
					<th>标签：</th>
					<td>
						<select name="Tag" class="<%=ContentLang%>Font">
							<option value="">-- 未指定 --</option>
							<ali:List Object="Tag">
								<ali:Record>
									<%If Int32.Equals(InnerID, Mail[TagID])%>
										<option value="<%=InnerID%>" selected="selected"><%=Name%></option>
									<%Else%>
										<option value="<%=InnerID%>"><%=Name%></option>
									<%EndIf%>
								</ali:Record>
							</ali:List>
						</select>
					</td>
				</tr>
				<tr>
					<th>对象：</th>
					<td>
						<%If Convert.ToBoolean(Mail[ToCompany])%>
							<input type="radio" name="ToCompany" id="ToCompanyYes" checked="checked" /><label for="ToCompanyYes">企业</label>
							<input type="radio" name="ToCompany" id="ToCompanyNo" /><label for="ToCompanyNo">个人</label>
						<%Else%>
							<input type="radio" name="ToCompany" id="ToCompanyYes" /><label for="ToCompanyYes">企业</label>
							<input type="radio" name="ToCompany" id="ToCompanyNo" checked="checked" /><label for="ToCompanyNo">个人</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>发送人：</th>
					<td>
						<select name="Creator">
							<ali:List ID="Sender" Object="MailSender" Operation="SenderList()">
								<ali:Record>
									<%If Guid.Equals(CreatorID, Mail[CreatorID])%>
										<option value="<%=CreatorID%>" selected="selected"><%=Creator%></option>
									<%Else%>
										<option value="<%=CreatorID%>"><%=Creator%></option>
									<%EndIf%>
								</ali:Record>
							</ali:List>
							<%If Sender[Count] == 0%>
								<option value="<%=User["ID"]%>"><%=User["Name"]%></option>
							<%EndIf%>
						</select>
					</td>
				</tr>
				<tr>
					<th>发送方式：</th>
					<td>
						<select name="Every">
							<option value="">手动</option>
							<option value="Once">定时</option>
							<optgroup label="定期">
								<option value="Year">每年</option>
								<option value="Season">每季</option>
								<option value="Month">每月</option>
								<option value="Week">每周</option>
								<option value="Day">每天</option>
								<option value="Hour">每小时</option>
							</optgroup>
						</select>
						<span id="Day" style="display:none">
							<input type="checkbox" name="Day" id="Monday" value="1" /><label for="Monday">周一</label>
							<input type="checkbox" name="Day" id="Tuesday" value="2" /><label for="Tuesday">周二</label>
							<input type="checkbox" name="Day" id="Wednesday" value="3" /><label for="Wednesday">周三</label>
							<input type="checkbox" name="Day" id="Thursday" value="4" /><label for="Thursday">周四</label>
							<input type="checkbox" name="Day" id="Friday" value="5" /><label for="Friday">周五</label>
							<input type="checkbox" name="Day" id="Saturday" value="6" /><label for="Saturday">周六</label>
							<input type="checkbox" name="Day" id="Sunday" value="0" /><label for="Sunday">周日</label>
						</span>
					</td>
				</tr>
				<tr id="StartTimeTR" style="display:none">
					<th>开始时间：</th>
					<td>
						<input type="text" name="Year" size="4" class="Text" />年
						<select name="Month">
							<option value="0">01</option>
							<option value="1">02</option>
							<option value="2">03</option>
							<option value="3">04</option>
							<option value="4">05</option>
							<option value="5">06</option>
							<option value="6">07</option>
							<option value="7">08</option>
							<option value="8">09</option>
							<option value="9">10</option>
							<option value="10">11</option>
							<option value="11">12</option>
						</select>月
						<select name="Date">
							<option value="1">01</option>
							<option value="2">02</option>
							<option value="3">03</option>
							<option value="4">04</option>
							<option value="5">05</option>
							<option value="6">06</option>
							<option value="7">07</option>
							<option value="8">08</option>
							<option value="9">09</option>
							<option value="10">10</option>
							<option value="11">11</option>
							<option value="12">12</option>
							<option value="13">13</option>
							<option value="14">14</option>
							<option value="15">15</option>
							<option value="16">16</option>
							<option value="17">17</option>
							<option value="18">18</option>
							<option value="19">19</option>
							<option value="20">20</option>
							<option value="21">21</option>
							<option value="22">22</option>
							<option value="23">23</option>
							<option value="24">24</option>
							<option value="25">25</option>
							<option value="26">26</option>
							<option value="27">27</option>
							<option value="28">28</option>
							<option value="29">29</option>
							<option value="30">30</option>
							<option value="31">31</option>
						</select>日
						<select name="Hour">
							<option value="0">00</option>
							<option value="1">01</option>
							<option value="2">02</option>
							<option value="3">03</option>
							<option value="4">04</option>
							<option value="5">05</option>
							<option value="6">06</option>
							<option value="7">07</option>
							<option value="8">08</option>
							<option value="9">09</option>
							<option value="10">10</option>
							<option value="11">11</option>
							<option value="12">12</option>
							<option value="13">13</option>
							<option value="14">14</option>
							<option value="15">15</option>
							<option value="16">16</option>
							<option value="17">17</option>
							<option value="18">18</option>
							<option value="19">19</option>
							<option value="20">20</option>
							<option value="21">21</option>
							<option value="22">22</option>
							<option value="23">23</option>
						</select>时
						<select name="Minute">
							<option value="0">00</option>
							<option value="1">01</option>
							<option value="2">02</option>
							<option value="3">03</option>
							<option value="4">04</option>
							<option value="5">05</option>
							<option value="6">06</option>
							<option value="7">07</option>
							<option value="8">08</option>
							<option value="9">09</option>
							<option value="10">10</option>
							<option value="11">11</option>
							<option value="12">12</option>
							<option value="13">13</option>
							<option value="14">14</option>
							<option value="15">15</option>
							<option value="16">16</option>
							<option value="17">17</option>
							<option value="18">18</option>
							<option value="19">19</option>
							<option value="20">20</option>
							<option value="21">21</option>
							<option value="22">22</option>
							<option value="23">23</option>
							<option value="24">24</option>
							<option value="25">25</option>
							<option value="26">26</option>
							<option value="27">27</option>
							<option value="28">28</option>
							<option value="29">29</option>
							<option value="30">30</option>
							<option value="32">32</option>
							<option value="33">33</option>
							<option value="34">34</option>
							<option value="35">35</option>
							<option value="36">36</option>
							<option value="37">37</option>
							<option value="38">38</option>
							<option value="39">39</option>
							<option value="40">40</option>
							<option value="41">41</option>
							<option value="42">42</option>
							<option value="43">43</option>
							<option value="44">44</option>
							<option value="45">45</option>
							<option value="46">46</option>
							<option value="47">47</option>
							<option value="48">48</option>
							<option value="49">49</option>
							<option value="50">50</option>
							<option value="51">51</option>
							<option value="52">52</option>
							<option value="53">53</option>
							<option value="54">54</option>
							<option value="55">55</option>
							<option value="56">56</option>
							<option value="57">57</option>
							<option value="58">58</option>
							<option value="59">59</option>
						</select>分
					</td>
				</tr>
				<tr>
					<th>间隔时间：</th>
					<td>		
						<input type="text" name="Interval" value="<%=Mail[Interval]%>" class="Text" />（秒）
					</td>
				</tr>
				<tr>
					<th>内容：</th>
					<td>
						<textarea name="Content" data-lang="<%=PageLang%>" data-content-lang="<%=ContentLang%>" data-browse-url="<%=AdminBrowserURL%>?Root=<%=InstanceID%>" class="editor"><%=HttpUtility.HtmlEncode(Mail[Content].ToString())%></textarea>
					</td>
				</tr>
				<tr>
					<th>最后运行：</th>
					<td><%=Mail[LastRun]%></td>
				</tr>
				<tr>
					<th>最后结束时间：</th>
					<td><input type="text" name="EndTime" value="<%=Mail[EndTime]%>" class="Text" /><a href="" id="Now">手动结束</a></td>
				</tr>
				<tr>
					<th>运行次数：</th>
					<td><%=Mail[RunTimes]%></td>
				</tr>
				<tr>
					<th>最后发送ID：</th>
					<td><input type="text" name="LastID" size="10" value="<%=Mail[LastID]%>" class="Text <%=ContentLang%>Font" /></td>
				</tr>
				<tr>
					<th>最后发送人序号：</th>
					<td><%=Mail[LastSenderIndex]%></td>
				</tr>
				<tr>
					<th>创建时间：</th>
					<td><%=Mail[CreateTime]%></td>
				</tr>
			</tbody>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=CommonPath%>jquery/ui.js"></script>
<script type="text/javascript" src="<%=CommonPath%>date_picker/date_picker.js"></script>
<script type="text/javascript" src="<%=CommonPath%>utility.js"></script>
<script type="text/javascript" src="<%=JsPath%>global.js"></script>
<script type="text/javascript" src="<%=ModuleJsPath%>module.js"></script>
</body>
</html>